%\documentclass[11pt,a4paper,oneside]{report}             % Single-side
\documentclass[11pt,a4paper,twoside,openright]{report}  % Duplex

%\PassOptionsToPackage{chapternumber=Huordinal}{magyar.ldf}
%\usepackage{hyperref}
\usepackage{t1enc}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{enumerate}
\usepackage[thmmarks]{ntheorem}
\usepackage{graphics}
\usepackage{epsfig}
\usepackage{listings}
\usepackage{color}
\usepackage{fancyhdr}
\usepackage{lastpage}
\usepackage{anysize}
\usepackage[magyar]{babel}
%\usepackage{natbib}
\usepackage{sectsty}
\usepackage{setspace}  % Ettol a tablazatok, abrak, labjegyzetek maradnak 1-es sorkozzel!
\usepackage[hang]{caption}
%\usepackage{todonotes}


%--------------------------------------------------------------------------------------
% Main variables
%--------------------------------------------------------------------------------------
\newcommand{\mitauthor}{Grill Balázs Levente}
\newcommand{\mitadvisor}{dr. Lapos Elemér}
\newcommand{\mitadvisortitle}{adjunktus}
\newcommand{\mittitle}{Űrlapok generálása tudásbázis alapján}


%--------------------------------------------------------------------------------------
% Redefine original \chapter and \section commands
%--------------------------------------------------------------------------------------
\let\oldchap=\chapter
\renewcommand*{\chapter}{\secdef{\chapternostar}{\chapterstar}}
\newcommand\chapterstar[1]{\oldchap*{#1}\markboth{~}{#1}\addcontentsline{toc}{chapter}{#1}}
%The first argument to \chapter is optional, hence the need for "[]"
%in the following definition. However, \secdef duplicates the mandatory
%argument if no optional argument was given. So we'll always have that
%argument and the default doesn't matter.
\newcommand\chapternostar[2][]{\oldchap[#1]{#2}\markboth{\thechapter. #1}{\thechapter. #1}}

\let\oldsect=\section
\renewcommand*{\section}{\secdef{\sectionnostar}{\sectionstar}}
\newcommand\sectionstar[1]{\oldsect{#1}\markright{\thesection. #1}}
\newcommand\sectionnostar[2][]{\oldsect[#1]{#2}\markright{\thesection. #1}}

%--------------------------------------------------------------------------------------
% Page layout setup
%--------------------------------------------------------------------------------------
% we need to redefine the pagestyle plain
% another possibility is to use the body of this command without \fancypagestyle
% and use \pagestyle{fancy} but in that case the special pages
% (like the ToC, the References, and the Chapter pages)remain in plane style
\fancypagestyle{plain}
{
	\fancyhead[R]{}
	\fancyhead[CO]{\bfseries\footnotesize\nouppercase{\rightmark}}
	\fancyhead[CE]{\bfseries\footnotesize\nouppercase{\leftmark}}
	\fancyhead[L]{}
	\fancyfoot[LE,RO]{}%\thepage}%{\thepage\pageref{LastPage}}
	\fancyfoot[C]{\thepage}
	\fancyfoot[LO,RE]{}
	\renewcommand{\headrulewidth}{0.4pt}
%	\renewcommand{\footrulewidth}{0.4pt}
}

\pagestyle{plain}
\setlength{\headheight}{15pt}
%\setlength{\parindent}{0pt} % �ttekinthet�bb, angol nyelv� dokumentumokban jellemz�
%\setlength{\parskip}{8pt plus 3pt minus 3pt} % �ttekinthet�bb, angol nyelv� dokumentumokban jellemz�
\setlength{\parindent}{12pt} % magyar nyelv� dokumentumokban jellemz�
\setlength{\parskip}{0pt}    % magyar nyelv� dokumentumokban jellemz�

\marginsize{35mm}{25mm}{15mm}{15mm} % anysize package
\setcounter{secnumdepth}{0}
%\setcitestyle{authoryear, round, comma, aysep={;}, yysep={,}, notesep={, }}
\sectionfont{\large\upshape\bfseries}

\setcounter{secnumdepth}{2}
\singlespacing

%--------------------------------------------------------------------------------------
%	Some new commands and declarations
%--------------------------------------------------------------------------------------
%\renewcommand{\captionfont}{\small\itshape}
%renewcommand{\captionlabelfont}{\small\upshape\bfseries}
\newcommand{\code}[1]{{\upshape\ttfamily\scriptsize\indent #1}}
\newcommand{\url}[1]{{\upshape\ttfamily\normalsize #1}}

% define references
\newcommand{\figref}[1]{\ref{fig:#1}.}
\renewcommand{\eqref}[1]{(\ref{eq:#1})}
\newcommand{\listref}[1]{\ref{listing:#1}.}
\newcommand{\sectref}[1]{\ref{sect:#1}}
\newcommand{\tabref}[1]{\ref{tab:#1}.}

\DeclareMathOperator*{\argmax}{arg\,max}
%\DeclareMathOperator*[1]{\floor}{arg\,max}
\DeclareMathOperator{\sign}{sgn}
\DeclareMathOperator{\rot}{rot}
\definecolor{lightgray}{rgb}{0.95,0.95,0.95}

\author{\mitauthor}
\title{\mittitle}
\includeonly{
	declaration,%
	preliminaries,%
	ch1introduction,%
	ch2requirements,%	
	ch3handlingforms,%
	ch4cms,%
	ch5knowledge,%
	ch6generate,%
	ch7process,%
	ch8results,%
	abstract,%
	%introduction,%
	%chapter1,%
	%chapter2,%
	%chapter3,%
	acknowledgement,%
	%appendices,%
}
%--------------------------------------------------------------------------------------
%	Setup captions
%--------------------------------------------------------------------------------------
\captionsetup[figure]{
%labelsep=none,
%font={footnotesize,it},
%justification=justified,
width=.75\textwidth,
aboveskip=10pt}

\renewcommand{\captionlabelfont}{\small\bf}
\renewcommand{\captionfont}{\footnotesize\it}

%--------------------------------------------------------------------------------------
% Table of contents and the main text
%--------------------------------------------------------------------------------------
\begin{document}

\singlespacing
%\pagenumbering{}

\include{preliminaries}
\include{declaration}
\include{abstract}

\pagenumbering{arabic}
\tableofcontents\vfill\markboth{Tartalomjegyzék}{~}

%\listoftodos

\onehalfspacing

%\pagenumbering{arabic}
\include{ch1introduction}
\include{ch2requirements}
\include{ch3handlingforms}
\include{ch4cms}
\include{ch5knowledge}
\include{ch6generate}
\include{ch7process}
\include{ch8results}
%\include{introduction}
%\include{chapter1}
%\include{chapter2}
%\include{chapter3}
\include{acknowledgement}
%\include{appendices}

\listoffigures%\addcontentsline{toc}{chapter}{�br�k jegyz�ke}
%\listoftables%\addcontentsline{toc}{chapter}{T�bl�zatok jegyz�ke}

\bibliography{mybib}\markboth{Irodalomjegyzék}{}
%\addcontentsline{toc}{chapter}{Irodalomjegyz�k}
\bibliographystyle{plain}

\label{page:last}

\end{document}
